home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mesolore
/
Mesolore - Disc 1.iso
/
pc
/
data
/
Buttons.cst
/
00265_Script_Bookmarks
< prev
next >
Wrap
Text File
|
2001-04-13
|
5KB
|
172 lines
-- BOOKMARKS --
global gSelectedLine, gRetraceList, gBookMarkRemoveSpr, gBookMarkGoSpr, gBookmarks, gMIAW
on showBookmarks -- invoked from Bookmark pulldown menu
open window "Bookmarks"
set the windowtype of window "Bookmarks" = 4
tell window "bookmarks" to set the visible of sprite 5 = FALSE
tell window "bookmarks" to set the visible of sprite 6 = FALSE
tell window "bookmarks" to hilite line 1 of field "input"
end showBookmarks
on shownotepad -- invoked from Bookmark pulldown menu
open window "Notepad"
set the windowtype of window "Notepad" = 4
end
on selectBookmark -- invoked when user clicks on text field within Bookmark MIAW
put the mouseLine into gSelectedLine
if gSelectedLine > 0 then
set the visible of sprite 5 = TRUE
set the visible of sprite 6 = TRUE
hilite line gSelectedLine of field "Bookmarks"
end if
end selectBookmark
-- These handlers are invoked when the user clicks one of the buttons in the
-- Bookmark MIAW.
on addBM
cursor 4
updatestage
put getLast( gRetraceList )into temp
--put searchScreenIndex(temp) into temp2
--put temp2 & " #"&temp & RETURN after field "Bookmarks"
if field "input" = "" then
alert "Please enter your bookmark's name before clicking the ADD button."
else
put field "input" & " #" & temp & RETURN after field "Bookmarks"
set the visible of sprite 5 = FALSE
set the visible of sprite 6 = FALSE
set gBookmarks = field "Bookmarks"
put "" into field "input"
end if
cursor 0
updatestage
end addBM
on searchScreenIndex temp
if char 1 of temp = "T" then
put "ScreenIndex2" into searchfield
else
put "ScreenIndex1" into searchfield
end if
put field (searchfield) into hold
put the number of lines in hold into HM
set the itemdelimiter = "#"
repeat with x = 1 to HM
if temp = item 1 of line x of hold then
return item 2 of line x of hold
exit repeat
end if
end repeat
set the itemdelimiter = ","
end
on removeBM
if gSelectedLine > 0 then
delete line gSelectedLine of field "Bookmarks"
set gBookmarks = field "Bookmarks"
set gSelectedLine = 0
end if
set the visible of sprite 5 = FALSE
set the visible of sprite 6 = FALSE
end removeBM
on goBM
if gSelectedLine > 0 then
set the itemdelimiter = "#"
set destination = item 2 of line gSelectedLine of field "Bookmarks"
if destination <> "" then
set the itemdelimiter = "*"
tell the stage to goTo item 1 of destination, item 2 of destination
set the itemdelimiter = ","
end if
end if
end goBM
on saveAsNotepad
set fio = new(XTRA "fileio")
filename = fio.displaySave("Save file as","my notepad.txt")
fio.createfile(filename)
fio.openfile(filename,2)
fio.writestring(field "bookmarks")
if the platform contains "macintosh" then
fio.setFinderInfo("TEXT ttxt")
end if
fio.closefile()
fio=0
end
on saveAsBM
set fio = new(XTRA "fileio")
filename = fio.displaySave("Save file as","my bookmarks.txt")
fio.createfile(filename)
fio.openfile(filename,2)
fio.writestring(field "bookmarks")
if the platform contains "macintosh" then
fio.setFinderInfo("TEXT ttxt")
end if
fio.closefile()
fio=0
end saveAsBM
on loadnotepad
set fio = new(XTRA "fileio")
if the platform contains "macintosh" then
fio.setfiltermask("TEXT")
else
fio.setfiltermask("*.txt")
end if
filename = fio.displayOpen()
if not voidp(filename) and not (filename = EMPTY) then
fio.openfile(filename,1)
if fio.status() = 0 then
theFile = fio.readFile()
put theFile into field "bookmarks"
else
alert "error"
end if
end if
fio.closefile()
fio = 0
-- set the visible of sprite 5 = FALSE
-- set the visible of sprite 6 = FALSE
-- put "" into field "input"
end
on loadBM
set fio = new(XTRA "fileio")
if the platform contains "macintosh" then
fio.setfiltermask("TEXT")
else
fio.setfiltermask("*.txt")
end if
filename = fio.displayOpen()
if not voidp(filename) and not (filename = EMPTY) then
fio.openfile(filename,1)
if fio.status() = 0 then
theFile = fio.readFile()
put theFile into field "bookmarks"
else
alert "error"
end if
end if
fio.closefile()
fio = 0
set the visible of sprite 5 = FALSE
set the visible of sprite 6 = FALSE
put "" into field "input"
end loadBM